<div class="toolbox divider nobr">
	<input type="button" id="users_brw" class="button" value="浏览" />
	<input type="button" id="users_add" class="button" value="添加" />
	<input type="button" id="users_mod" class="button" value="修改" />
	<input type="button" id="users_del" class="button" value="删除" />
	<input type="button" id="users_auth" class="button" value="权限" />
</div>
<!--
<div class="toolbox divider">
	<span class="iconWrapper"><img src="none.gif" width="16" height="16" alt="添加" title="添加" /></span>
	<span class="iconWrapper"><img src="none.gif" width="16" height="16" alt="修改" title="修改" /></span>
	<span class="iconWrapper"><img src="none.gif" width="16" height="16" alt="删除" title="删除" /></span>
</div>
-->
<script type="text/javascript">
	var mainPanel = 'mainPanel';
	var item_value ,del_ids;
	
	$('users_brw').addEvent('click', function(e){
		MUI.updateContent({
			'element':  $(mainPanel),
			'url':      '/mochaui/data/users.html',
			//'onContentLoaded' : function(){ users.findList(1);}
		});
	});
	
	$('users_add').addEvent('click', function(e){
		MUI.updateContent({
			'element':  $(mainPanel),
			'url':      '/mochaui/data/users.add.html',
			require: {
						css: [MUI.path.plugins + 'calendar/css/calendar.css'],			
						js: [MUI.path.plugins + 'calendar/scripts/calendar.js'],
						onload: function(){
							//myCal1 = new Calendar({ endtime: 'Y-m-d' }, { direction: 1, tweak: { x: 6, y: 0 }});;
							myCal1 = new Calendar({ endtime: 'Y-m-d' });;
						}	
					}	
		});
	});
	
	$('users_mod').addEvent('click', function(e){
		if(users.checkIds()==1){
			var item = users.findFirstIds();
			item_value = item.value;		
			MUI.updateContent({
				'element':  $(mainPanel),
				'url':      '/mochaui/data/users.mod.html',
			require: {
						css: [MUI.path.plugins + 'calendar/css/calendar.css'],			
						js: [MUI.path.plugins + 'calendar/scripts/calendar.js'],
						onload: function(){
							//myCal1 = new Calendar({ endtime: 'Y-m-d' }, { direction: 1, tweak: { x: 6, y: 0 }});;
							myCal1 = new Calendar({ endtime: 'Y-m-d' });;
						}	
					}
			});
		}else{
			MUI.notification('<font color=red>错误：</font>只能选择一条记录进行修改！');
			return;
		}
	});
	
	$('users_del').addEvent('click', function(e){
		if(users.checkIds()>=1){
			var confirm = confirmWindow('删除用户','确定要删除选中的用户？<input id="comfirm" type="button" value="确定" ><input id="cancel" type="button" value="取消" >');
			$('comfirm').addEvent('click',function(e){
				confirm.close();
				var itemarr = users.findIds();
				del_ids = users.arrCbToStr(itemarr);	
				 MUI.updateContent({
					'element':  $(mainPanel),
					'url':      '/mochaui/data/users.del.html'
				}); 
			});
			$('cancel').addEvent('click',function(e){
				confirm.close();
			});
			
		}else{
			MUI.notification('<font color=red>错误：</font>至少选择一条记录！');
			return;
		}
	});
	
	$('users_auth').addEvent('click', function(e){
		if(users.checkIds()==1){
			var item = users.findFirstIds();
			item_value = item.value;		
			new MUI.Column({
				container: mainPanel,
				id: 'authTreeCol',
				placement: 'left',
				width: 200,
				resizeLimit: [100, 300]
			});
			
			new MUI.Column({
				container: mainPanel,
				id: 'authContentCol',
				placement: 'main',
				width: null,
				resizeLimit: [100, 300]
			});
			
			new MUI.Panel({
				header: false,
				id: 'authTreePanel',
				addClass: 'panelAlt',
				contentURL: '/mochaui/data/auth.setter.html',
				column: 'authTreeCol'
			});  
			
			new MUI.Panel({
				header: false,
				id: 'authContentPanel',
				addClass: 'panelAlt',
				contentURL: '/mochaui/data/users.auth.setter.html',
				column: 'authContentCol'
			});   
		}else{
			MUI.notification('<font color=red>错误：</font>只能选择一条记录权限设置！');
			return;
		}
	});
	
</script>
	